<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta name="Description" content="Simple dotProject Style" />
	<meta http-equiv="Content-Type"
		content="text/html;charset=<?=isset( $locale_char_set ) ? $locale_char_set : 'UTF-8'?>"/>
	<title><?=dPgetConfig( 'page_title' )?></title>
	<link rel="icon" href="images/dragon.png" type="image/x-icon">
	<link rel="shortcut icon" href="images/dragon.png" type="image/x-icon">
	<link rel="stylesheet" type="text/css" href="style/default/main.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style/default/calendar.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style/tree.css" media="all" />

	<!--[if IE 6]>
	<link rel="stylesheet" type="text/css" href="style/default/ie6.css" media="all" />
	<![endif]-->

	<!--[if IE]>
	<link rel="stylesheet" type="text/css" href="style/default/ie.css" media="all" />
	<![endif]-->

	<style>
		div.autocompleter-loading{
			clear:					right;
			background:				#fff url(images/spinner.gif) no-repeat center;
			width:					20px;
			height:					16px;
		}

		img.autocompleter-trigger{
			background:transparent url(/images/trigger.gif) no-repeat scroll 0pt;
			border-color:-moz-use-text-color -moz-use-text-color #B5B8C8;
			border-style:none none solid;
			border-width:0pt 0pt 0pt 0pt;
			cursor:pointer;
			height:21px;
			position:relative;
			width:17px;
			top: 7px;
		}
		img.autocompleter-trigger:hover{
			background:transparent url(/images/trigger.gif) no-repeat scroll -18px 0px;
		}

		div.autocompleter-uparrow{
			width:					16px;
			height:					16px;
		}

		ul.autocompleter-choices 
		{
			position:				absolute;
			margin:					0;
			padding:				0;
			list-style:				none;
			border:					1px solid #eee;
			background-color:		#fffaef;
			border-right-color:		#808080;
			border-bottom-color:	#808080;
			border-left-color:		#808080;
			text-align:				left;
			font-family:			Verdana, Geneva, Arial, Helvetica, sans-serif;
			z-index:				50;
			overflow-y: auto;
			overflow-x: hidden;
		}		

		ul.autocompleter-choices li
		{
			position:				relative;
			padding:				0.3em 1.5em 0.3em 1em;
			cursor:					pointer;
			font-weight:			normal;
			font-size:				11px;
		}

		ul.autocompleter-choices li.autocompleter-selected 
		{
			background-color:		#86abd9;
			color:					#fff;
		}

		ul.autocompleter-choices span.autocompleter-queried
		{
			font-weight:			bold;
		}

		ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried
		{
			color: #9FCFFF;
		}
		
		ul.autocompleter-choices li label{
			font-weight: bold;
		}
		
		ul.autocompleter-choices li ul{
			list-style:				none;
			margin:					0;
			padding:				0;
		}
	</style>
	<?php $AppUI->loadJS(); ?>
</head>
<body class="mainpage" onresize="Contents.resize()" onload="Contents.setup()">
<!--[if lte IE 6.5]>
<script>
document.body.onresize = null;
</script>
<div onresize="Contents.resize()" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 0px"></div>
<div onresize="Contents.resize()" style="position: absolute; left: 0px; top: 0px; width: 0px; height: 100%"></div>
<![endif]-->
<div id="idGlass" style="display:none; visibility: hidden; overflow: hidden">
<!--[if lte IE 6.5]><iframe src="dummy.html"></iframe><![endif]-->
</div>
<div id="idShadow" style="display:none; visibility: hidden">&nbsp;</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%">
<tr>
	<td colspan="100%" id="idTopContents">
		<table class="nav" width="100%" cellpadding="2" cellspacing="0">
		<tr>
		<td width="90%">&nbsp;
			<a href="<?=$dPconfig['base_url']?>"><?=$dPconfig['company_name']?></a>
		</td>
		<!-- trangdt add -->
		<td>
			<form name="frm_new" method=GET action="./index.php">
				<input type="hidden" name="a" value="addedit" />
				<?php
					$newItem = array('' => 'New');
					if ($perms->checkModule( 'projects', 'edit' )) $newItem["projects"] = "References";
					if ($perms->checkModule( 'companies', 'edit' )) $newItem["companies"] = "Customer";
					if ($perms->checkModule( 'quotations', 'edit' )) $newItem["quotations"] = "Quotation";
					echo arraySelect( $newItem, 'm', 'style="font-size:10px" onChange="f=document.frm_new;mod=f.m.options[f.m.selectedIndex].value;if(mod) f.submit();"', '', true);
				?>
			</form>
		</td>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<!-- trangdt end -->
		<td>
			<?php
				$searchItem = array('all' => 'Search All');
				if ($perms->checkModule( 'projects', 'view' )) $searchItem["references"] = "References";
				if ($perms->checkModule( 'companies', 'view' )) $searchItem["companies"] = "Customer";
				if ($perms->checkModule( 'quotations', 'view' )) $searchItem["quotations"] = "Quotation";
				if ($perms->checkModule( 'tasks', 'view' )) $searchItem["tasks"] = "Task";
				echo arraySelect($searchItem, 'obj_search', 'id="obj_search_autocompleter" style="font-size:10px" onchange="changeAutocompleter(this)"', "");
			?>
		</td>
		<td nowrap="nowrap">
			<input type="text" name="keyword" id="idKeyword" value="" size="30" maxlength="30"/>
		</td>
		<td>
			<div id="indicator2" class="autocompleter-loading" style="visibility: hidden;">&nbsp;</div>
			<!--img style="vertical-align: text-bottom" class="clickable" src="images/kghostview.png" onclick=""/-->
		</td>
		<script type="text/javascript" language="javascript">
			//<![CDATA[
			/**
			 * Example part
			 */
			var url = 'index.php?m=public&a=auto_completer&format=json&suppressHeaders=1';
			var completer2 = null;
			window.addEvent('domready', function(){
				var el = $('idKeyword');
				/**
				 * Json format
				 *
				 */
				var indicator2 = $('indicator2');
				completer2 = new Autocompleter.Ajax.Json(el, url + '&obj_search=' + $('obj_search_autocompleter').value, {
					'maxChoices' : 100,
					'onRequest': function(el) {
						indicator2.setStyle('visibility', 'visible');
					},
					'onComplete': function(el) {
						indicator2.setStyle('visibility', 'hidden');
					},					
					'injectChoice': function(choice) {
						var el = new Element('li').setHTML("[" + choice.code + "]").adopt(new Element('span', {'class': 'example-info'}).setHTML(' - <b>' + this.markQueryValue(choice.name) + '</b>'));
						el.inputValue = choice.name;
						el.link = choice.link;
						this.addChoiceEvents(el).injectInside(this.choices);
					}
				});

			});

			function changeAutocompleter(idSelect){
				var val = idSelect.value;
				completer2.ajax.url = url + '&obj_search=' + val;
			}
			//]]>
		</script>
		<!-- End Autocomplete -->
		<td width="16px"><img src="images/user.gif"></td>
		<td nowrap width="34%"><?=$AppUI->user_first_name.' '.$AppUI->user_last_name?></td>
		<td width="32px">&nbsp;</td>
		<td width="33%" align="right">
		<table cellpadding="0" cellspacing="6">
		<tr height="22px">
			<td align="center"><a href="index.php?m=admin&a=viewuser&user_id=<?=$AppUI->user_id?>"><img src="images/vcard.gif" title="<?=$AppUI->_('My Info')?>"/></a></td>
			<td align="center"><a href="#"><img src="images/stickies.gif" title="<?=$AppUI->_('Notes')?>"/></a></td>
			<td align="center"><a href="#"><img src="images/manual.gif" title="<?=$AppUI->_('Help')?>"/></a></td>
			<td align="center"><img src="images/blank.gif" width="10" height="1"/></td>
			<td align="center"><a href="index.php?logout=-1"><img src="images/close.gif" title="<?=$AppUI->_('Logout')?>"/></a></td>
		</tr>
		</table>
		</td>
		</td>
		</tr>
		</table>
	</td>
</tr>
<tr>
<td valign="top" class="toolbar">
<?php
	$nav = $AppUI->getMenuModules();
	if ($_SESSION['Toolbar[show]'] == 'off') {
		$style = 'style="display: none"';
		$handler = 'expand.gif';
		$title = 'Expand';
	}
	else {
		$style = '';
		$handler = 'collapse.gif';
		$title = 'Collapse';
	}
	$top = isset($_SESSION['Toolbar[top]']) ? ' style="top: '.$_SESSION['Toolbar[top]'].'px"' : '';
?>
	<table id="idToolbar" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td rowspan="3" <?=$style?> style="padding: 2px"><img src="images/blank.gif" width="3" height="1"></td>
			<td id="idToolbarUp" <?=$style?> class="scroll_no" onmousedown="Toolbar('idToolbar').scroll(this)">&nbsp;</td>
			<td class="clickable" rowspan="3" valign="top" style="padding: 2px" onclick="Toolbar('idToolbar').toggle()">
				<img id="idToolbarHandler" title="<?=$title?>" src="images/<?=$handler?>">
			</td>
		</tr>
		<tr>
			<td <?=$style?> align="center">
			<div id="idToolbarContainer">
			<div id="idToolbarSlider"<?=$top?>>
				<table id="idToolbarTray" border="0" cellpadding="2" cellspacing="2" width="100%">
				<?php
				foreach ($nav as $module) {
					$dir = $module['mod_directory'];
					if (!getDenyRead( $dir )) {
						$icon = $module['mod_ui_icon'];
						$name = $AppUI->_($module['mod_ui_name']);
						$sel = '';
						if ($m == $dir) {
							define('DP_CURRENT_MODULE_ICON', $icon);
							$name = '<b>'.$name.'</b>';
							$sel = ' id="idSelected"';
						}
				?>
					<tr<?=$sel?> onclick="go('index.php?m=<?=$dir?>')">
						<td align="center" valign="middle" class="clsBtnOff">
							<?=showFixedSizeImage('modules/'.$dir.'/images/'.$icon)?><br/><?=$name?>
						</td>
					</tr>
				<?
					}
				}
				?>
				</table>
				</div>
			</div>
			</td>
		</tr>
		<tr>
			<td id="idToolbarDn" <?=$style?> class="scroll_dn" onmousedown="Toolbar('idToolbar').scroll(this)">&nbsp;</td>
		</tr>
	</table>
</td>

<td valign="top" align="left" width="100%">
<div id="idMainContents">
	<div id="idInnerContents" style="width: 100%">
